package com.ben.multiple.poi.rest;

import com.ben.multiple.poi.model.LongModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author BenJin Yin
 * @date 2020/6/2
 */
@RestController
@RequestMapping("/long")
@Slf4j
public class LongResource {

    @PostMapping
    public LongModel add(@RequestBody LongModel model) {
        log.info(model.toString());
        return model;
    }

    @GetMapping
    public LongModel get() {
        LongModel model = new LongModel();
        model.setId(1);
        model.setName("a");
        model.setTime(System.currentTimeMillis());
        model.setSize(1000000000000000009L);
        return model;
    }

}
